( Copyright {C} Hewlett-Packard Company 1996 ) ( ) ( Script File : X25_CALL.F ) ( ) ( This test script will demonstrate how to send calls, data, and clear all logical channels supported on the X.25 Emulation. ENTER FUNCTION KEY F1 TO START THE TEST, FUNCTION KEY F2 TO STOP THE TEST Function key F1 : Start test and send a Call, Data, Data, Clear packets on all logical channels. Function key F2 : Start test and send a Call, Data, Data, Clear packets on all logical channels, then repeat this sequence. Function key F3 : Stop test. ) ( ==================================================================== ) ( Initialize test manager when test script is loaded. ) TCLR ( Clear test manager state definitions ) ( ==================================================================== ) ( Define Labels for TestKeys topic ) 0 STATE_INIT{ " Start Test" 1 LABEL_KEY " Stop Test" 2 LABEL_KEY " Continuous" 3 LABEL_KEY " TestKeys" SET_CURR_TOPIC }STATE_INIT ( ==================================================================== ) ( State 0 will wait for function key entry to start test. F1 will start test sequence once, F1 will repeat test sequence. Test will start with by sending a SABM frame to initialize the link, then the test will go to state 1. Function key F2 can be used in any state to stop the test traffic. ) 0 STATE{ UF1 ?KEY ACTION{ T." Test Starting" TCR 0 COUNTER1 ! ( Send Call, Data, Data, Clear sequence ) SABM 1 NEW_STATE }ACTION UF2 ?KEY ( F2 ) ACTION{ T." Test Finished" TCR TM_STOP " UF1" 1 LABEL_KEY " UF2" 2 LABEL_KEY }ACTION UF3 ?KEY ACTION{ T." Test Starting, Continuous Traffic" TCR 1 COUNTER1 ! ( Repeat: Call, Data, Data, Clear ) SABM 1 NEW_STATE }ACTION R*SABM 1 ?RX ACTION{ }ACTION ( Execute protocol state machine ) }STATE ( ==================================================================== ) ( State 1 will wait for the UA reponse, send a Restart Request packet and then go to state 2. ) 1 STATE_INIT{ " " 1 LABEL_KEY " " 3 LABEL_KEY }STATE_INIT 1 STATE{ R*UA 1 ?RX ACTION{ RESTART 2 NEW_STATE }ACTION UF2 ?KEY ( F2 ) ACTION{ RESTART 7 NEW_STATE }ACTION }STATE ( ==================================================================== ) ( State 2 will wait for the Restart Confirm reponse, send Call Request packets on the first 8 logical channels, and then go to state 3. ) 2 STATE{ R*RESTARTCONF 1 ?RX ACTION{ CH1 CALL CH2 CALL CH3 CALL CH4 CALL CH5 CALL CH6 CALL CH7 CALL CH8 CALL 8 COUNTER ! 3 NEW_STATE }ACTION UF2 ?KEY ( F2 ) ACTION{ RESTART 7 NEW_STATE }ACTION }STATE ( ==================================================================== ) ( State 3 will wait for the next Call Confirm reponse, and then send another Call Request on the next logical channel. After Call requests have been sent on all logical channels, then a data packet will be sent on the first logical channel, and the test will then go to state 4. ) 3 STATE{ R*CALLCON 1 ?RX ACTION{ 1 COUNTER +! COUNTER @ LCNCOUNT > IF LCN @ ( Get lcn for received Clear confirm ) LCNCOUNT CH LCN @ = ( Lcn for last channel ) IF CH1 DATA CH2 DATA CH3 DATA CH4 DATA CH5 DATA CH6 DATA CH7 DATA CH8 DATA 8 COUNTER ! 4 NEW_STATE THEN ELSE COUNTER @ CH CALL THEN }ACTION UF2 ?KEY ( F2 ) ACTION{ RESTART 7 NEW_STATE }ACTION }STATE ( ==================================================================== ) ( State 4 will wait for the next Receive Ready packet, and then send another Data packet on the next logical channel. After a Data packet has been sent on all logical channels, then a second Data packet will be sent on the first logical channel, and the test will then go to state 5. ) 4 STATE{ R*RRP 1 ?RX ACTION{ 1 COUNTER +! COUNTER @ LCNCOUNT > IF CH1 DATA ( Send second data packet on LCN ) 1 COUNTER ! 5 NEW_STATE ELSE COUNTER @ CH DATA ( Send first data packet on LCN ) THEN }ACTION UF2 ?KEY ( F2 ) ACTION{ RESTART 7 NEW_STATE }ACTION }STATE ( ==================================================================== ) ( State 5 will wait for the next Receive Ready packet, and then send another Data packet on the next logical channel. After a Data packet has been sent on all logical channels, a Clear Request packet will be sent on the first logical channel, and the test will then go to state 6. ) 5 STATE{ R*RRP 1 ?RX ACTION{ 1 COUNTER +! COUNTER @ LCNCOUNT > IF LCN @ ( Get lcn for received packet ) LCNCOUNT CH LCN @ = ( Lcn for last channel ) IF CH1 CLEAR 1 COUNTER ! 6 NEW_STATE THEN ELSE COUNTER @ CH DATA THEN }ACTION UF2 ?KEY ( F2 ) ACTION{ RESTART 7 NEW_STATE }ACTION }STATE ( ==================================================================== ) ( State 6 will wait for the next Clear Confirm packet, and then send a Clear Request packet on the next logical channel. After a Clear Request has been sent on all logical channels, the test will check to see if continuous mode is selected. - If continuous mode was selected, then it will send Call Request packets on the first 8 logical channels, and then go to state 3. - If a single test sequence was selected, then the test will go to state 9. ) 6 STATE{ R*CLEARCONF R*RRP 2 ?RX ACTION{ 1 COUNTER +! COUNTER @ LCNCOUNT > IF COUNTER1 @ IF LCN @ ( Get lcn for received Clear confirm ) LCNCOUNT CH LCN @ = ( Lcn for last channel ) IF CH1 CALL CH2 CALL CH3 CALL CH4 CALL CH5 CALL CH6 CALL CH7 CALL CH8 CALL 8 COUNTER ! 3 NEW_STATE THEN ELSE 9 NEW_STATE THEN ELSE COUNTER @ CH CLEAR THEN }ACTION UF2 ?KEY ( F2 ) ACTION{ RESTART 7 NEW_STATE }ACTION }STATE ( ==================================================================== ) ( State 7 will wait for the Restart Confirm packet, will then send a Disc Frame, and go to state 8. ) 7 STATE{ R*RESTARTCONF 1 ?RX ACTION{ DISC 8 NEW_STATE }ACTION UF2 ?KEY ( F2 ) ACTION{ DISC 8 NEW_STATE }ACTION }STATE ( ==================================================================== ) ( State 8 will wait for the UA frame, will then go to state 9. ) 8 STATE{ R*UA 1 ?RX ACTION{ 9 NEW_STATE }ACTION UF2 ?KEY ( F2 ) ACTION{ T." Test Finished" TCR TM_STOP CLEAR_KEYS }ACTION }STATE ( ==================================================================== ) ( State 9 will wait for F1, F2, or F3 function key entry. ) 9 STATE_INIT{ " Start Test" 1 LABEL_KEY " Stop Test" 2 LABEL_KEY " Continuous" 3 LABEL_KEY }STATE_INIT 9 STATE{ UF1 ?KEY ACTION{ T." Test Starting" TCR 0 COUNTER1 ! ( Send Call, Data, Data, Clear ) CH1 CALL CH2 CALL CH3 CALL CH4 CALL CH5 CALL CH6 CALL CH7 CALL CH8 CALL 8 COUNTER ! 3 NEW_STATE }ACTION UF2 ?KEY ( F2 ) ACTION{ T." Test Finished" TCR TM_STOP CLEAR_KEYS }ACTION UF3 ?KEY ACTION{ T." Test Starting, Continuous Traffic" TCR 1 COUNTER1 ! ( Repeat: Call, Data, Data, Clear ) SABM 1 NEW_STATE }ACTION R*SABM 1 ?RX ACTION{ }ACTION ( Execute protocol state machine ) }STATE ( ==================================================================== )